<template>
  <div class="co_channels_channels co_party">
    <Row style="width: 600px;">
      <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="100">
        <FormItem label="合作方名称">
          <Input type="text" v-model="formValidate.partnerName" style="width: 280px;" disabled></Input>
        </FormItem>
        <FormItem label="合作渠道名称">
          <Input
            type="text"
            v-model="formValidate.channelName"
            style="width: 280px;"
            disabled
            :maxlength="50"
          ></Input>
        </FormItem>
        <FormItem label="APPID">
          <Input
            type="text"
            disabled
            v-model="formValidate.appId"
            style="width: 280px;"
            :maxlength="36"
          ></Input>
        </FormItem>
        <FormItem label="秘钥">
          <Input
            type="text"
            v-model="formValidate.appSecret"
             disabled
            style="width: 280px;"
            :maxlength="36"
          ></Input>
        </FormItem>
        <FormItem label="加密方式">
          <Select v-model="formValidate.signType" style="width:280px"  disabled>
               <Option value="MD5">MD5</Option>
          </Select>
        </FormItem>
        <FormItem class="form-btn" style="margin-top: 5px;">
          <Button type="primary" class="pa-submit-btn" style="margin-right: 15px;" @click="back">返回</Button>
        </FormItem>
      </Form>
    </Row>
    <!-- </div> -->
  </div>
</template>
<script>
import { getChannelInfo } from '@/api/system/fishing.js'
import { routeEqual } from '@/libs/util'
import './main.less'
export default {
  name: 'cooperation_channels_detail',
  data () {
    return {
      formValidate: {
        partnerName: '',
        channelName: '',
        appId: '',
        appSecret: '',
        signType: 'MD5'
      },
      model: '',
      cityList: [],
      ruleValidate: {

      }
    }
  },
  mounted () {
    this.getDetail()
  },
  methods: {
    back () {
      this.closeModal()
    },
    closeModal () {
      this.$store.commit('closeTag', this.$route)
      this.$store.commit('setTagNavList', this.$store.state.app.tagNavList.filter(item => !routeEqual(this.$route, item)))
      this.$nextTick(() => {
        this.$router.push({
          name: 'cooperation_channels_list'
        })
      })
    },
    getDetail () {
      getChannelInfo({
        merchantId: this.$store.state.user.merchantId,
        channelId: this.$route.query.id
      }).then(res => {
        if (res.data.status === 200) {
          this.formValidate = res.data.data
        } else {
          this.$Message.error(`${res.data.error}`)
        }
      })
    }
  }
}
</script>
